/**
 * 更新登录token
 * @param {*} state 
 * @param {*} token 
 */
const updateToken = (state, token) => {
    state.token = token;
    sessionStorage.token = token;
};

/**
 * 更新登录地址
 * @param {*} state 
 * @param {*} loginUrl 
 */
const updateLoginUrl = (state, loginUrl) => {
    state.loginUrl = loginUrl;
    sessionStorage.loginUrl = loginUrl;
}

/**
 * 更新资源菜单
 * @param {*} state 
 * @param {*} permissionList 
 */
const updatePermissionMenu = (state, permissionList) => {
    state.permissionList = permissionList;
    sessionStorage.permissionList = JSON.stringify(permissionList);
}

/**
 * 清空
 */
const clear = () => {
    sessionStorage.clear()
}

export default {
    updateToken,
    updateLoginUrl,
    updatePermissionMenu,
    clear
}